import ffmpeg

inputVideoName = "D:\\tongtong\\shortPlay\\不良人短剧导入测试\\不良人4.mp4"

def get_video_info(video_path):
    probe = ffmpeg.probe(video_path)
    video_stream = next((stream for stream in probe['streams'] if stream['codec_type'] == 'video'), None)
    if video_stream is not None:
        width = int(video_stream['width'])
        height = int(video_stream['height'])
        duration = float(video_stream['duration'])
        return width, height, duration

print(get_video_info(inputVideoName))


